<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/vue.js"></script>
    <script src="/js/axios.js"></script>
    <script src="/js/util.js"></script>
</head>
<body>

        <div id="app">

            <table cellpadding="0" cellspacing="0" border="1">
                <tr>
                    <td>学生姓名</td>
                    <td>学生年龄</td>
                    <td>学生性别</td>
                    <td>身份证号</td>
                    <td>状态</td>
                    <td>所属班级</td>
                </tr>

                <tr v-for="item in page.list">
                    <td>{{item.sname}}</td>
                    <td>{{item.age}}</td>
                    <td v-if="item.sex==1">男</td>
                    <td v-if="item.sex==2">女</td>
                    <td>{{item.sheng}}</td>
                    <td v-if="item.status==1">好</td>
                    <td v-if="item.status==2">还行</td>
                    <td>{{item.dname}}</td>
                </tr>
            </table>

            <button @click="findPage(1)">首页</button>
            <button @click="findPage(page.prePage)">上一页</button>
            <button @click="findPage(page.nextPage)">下一页</button>
            <button @click="findPage(page.lastPage)">尾页</button>
        </div>


<script>
    new Vue({
        el:"#app",
        data:{
            page:{},
        },
        created(){
            this.findPage(1);
        },
        methods:{
            findPage(pageIndex){
                axios.get("/student/findPage.do?pageIndex="+pageIndex).then(res=>{
                    this.page=res.data;
                })
            }
        },

    })
</script>
</body>
</html>